﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="User_Inventory2.ascx.cs" Inherits="Control_Inventory_User_Inventory2" %>
<%@ Register src="User_Inventory.ascx" tagname="User_Inventory" tagprefix="uc1" %>
<style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>



<script type="text/javascript">

    function hidediv() {
        if (document.getElementById) { // DOM3 = IE5, NS6 
            document.getElementById('hideshow').style.visibility = 'hidden';
        }
        else {
            if (document.layers) { // Netscape 4 
                document.hideshow.visibility = 'hidden';
            }
            else { // IE 4 
                document.all.hideshow.style.visibility = 'hidden';
            }
        }
    }

    function showdiv() {
        if (document.getElementById) { // DOM3 = IE5, NS6 
            document.getElementById('hideshow').style.visibility = 'visible';

        }
        else {
            if (document.layers) { // Netscape 4 
                document.hideshow.visibility = 'visible';
            }
            else { // IE 4 
                document.all.hideshow.style.visibility = 'visible';
            }
        }
        return false;
    }   
    
    function changeQuantity(item,lblid,id,proTypeName,txtProTypeId,hdId) {        
        var type = item.options[item.selectedIndex].value;       
        var lbl=document.getElementById(lblid);
        var txtProType=document.getElementById(txtProTypeId);
        var hidenct=document.getElementById(hdId);
        hidenct.value=id;
        txtProType.value=proTypeName;        
        if (item.selectedIndex == 0) {
            showdiv();     
            lbl.innerHTML='';       
        }
        else {
            hidediv();
            lbl.innerHTML=type;
           // var qty = document.getElementById('Label1');  
        }
      

        return false;
    }

    function clearDropDownList(sel1) {
        len1 = sel1.options.length;
        for (i = len1; i >= 0; i--) {
            sel1.options[i] = null;
        }
    }
    //
    //ajax functions
    //

    function addNewProduct(){
        var pro_name = document.getElementById('txtProName').value;
        var pro_description = document.getElementById('txtProDescription').value;
        var pro_price = document.getElementById('txtProPrice').value;
        var pro_quantity  = document.getElementById('txtProQuantity').value;

        if (cliname.trim() == '') {
            //show message
        } else if (cliphone.trim() == '') {
            //show message
        } else {
            Ajax_Control_Appointment_app.addNewClient(cliname, cliemail, cliphone, addNewClient_callback);
        }
    } 

</script>
<div id="hideshow" style="position: absolute; opacity: 1; filter: alpha(opacity=100);
        width: 768px; height: 800px; background-color: white; background-image: url(images/bg.png);
            background-repeat: repeat; width: 100%; content-align: center; v-align: middle;
        visibility: hidden">
        
            <a href="#" onclick="hidediv()" style="text-decoration: none;
                float: right; color: Red; font-size: 20px;">X</a>
            <div>
                <label for="proName">
                    Product Type Name</label>
              <input type="hidden" id="hdTempId" runat="server" />
                <asp:TextBox ID="txtProTypeName" runat="server"></asp:TextBox>
            </div>    
            <div>
                <label for="proName">
                    Product Name</label>
              
                <asp:TextBox ID="txtProName" runat="server"></asp:TextBox>
            </div>
            <div>
                <label for="description">
                    Description</label>
                 <asp:TextBox ID="txtProDescription" runat="server"></asp:TextBox>
            </div>
            <div>
                <label for="price">
                    Price</label>
                 <asp:TextBox ID="txtProPrice" runat="server"></asp:TextBox>
            </div>
             <div>
                <label for="quantity">
                    Quantity</label>
                 <asp:TextBox ID="txtProQuantity" runat="server"></asp:TextBox>
            </div>
            <br />
            <div>
                <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="addNewProduct" />
            </div>            
       
</div>  
<div id="content" style=" overflow:scroll; overflow-x: hidden; height: 791px;" >
            <table class="style1" width="748px">
                <tr>
                    <td style="text-align: center">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="text-align: left; font-family: CAMbria; font-size: 36px; color: #000000;">
                                                &nbsp; <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="30px" Text="INVENTORY" 
                            Font-Names="Cambria"></asp:Label>
                        </td>
                </tr>
                <tr>
                    <td style="text-align: center">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="text-align: center; border:orange;">
            <asp:GridView ID="GVInventory" runat="server" CellPadding="4" BackColor="White" 
                BorderColor="#FF9933" BorderStyle="Solid" BorderWidth="1px" 
                AutoGenerateColumns="False" Width="741px" Font-Bold="True" Font-Size="17px" >
                <RowStyle Height="44px" />
                <Columns>                    
                    <asp:BoundField DataField="PROTYP_ID" HeaderText="PRODUCT TYPE ID" >
                        <ControlStyle Font-Size="17pt" BorderColor="Orange" />
                        <ItemStyle  Font-Size="17px" Height="44px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="PROTYP_NAME" HeaderText="PRODUCT TYPE NAME " />
                    <asp:TemplateField HeaderText="PRODUCT NAME">
                     <ItemTemplate>
                        
                        <asp:DropDownList ID="DDProduct" runat="server" DataValueField="DataValueField" DataTextField="DataTextField" AutoPostBack ="true" >
                        </asp:DropDownList>                      
                     </ItemTemplate>
                    
                        <ControlStyle Font-Bold="True" Font-Size="17px" />
                    
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="QTY">
                    <ItemTemplate>
                   
                          
                        <asp:Label ID="Label1" runat="server"></asp:Label>                          
                        </ItemTemplate>
                    
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCCCC" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#FF9933" Font-Bold="True" ForeColor="White" 
                    Height="44px" BorderStyle="Solid" BorderColor="#FF9933" Font-Size="17px" />
            </asp:GridView>
       
                    </td>
                </tr>
            </table>
       
</div>

     